package 编程;

import java.util.Arrays;

public class Test4 {
    public static void main(String[] args) {
        int  [] arr={10,20,54,55,58,6454,4454,11};
        //冒泡排序
        System.out.println("排序前："+ Arrays.toString(arr));
        for (int  i=0;i<arr.length;i++){
            for (int  j=0; j<arr.length-1-i;j++){
                if (arr[j]>arr[j+1]){
                    int temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }
        }
        System.out.println("排序后："+Arrays.toString(arr));
    }
}


